<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const arr = [5,3,2,8,3,11,18,2,6,5,10,12,14,7]
        // 数组从小到大排序
        const a = arr.sort((a,b)=>{
             return a-b;
        });
        //01获取最大值，最小值
        console.log('最小值：', a[0] + '\n' + '最大值：',a[a.length-1])

        //02求平均值
        let res = arr.reduce((prev,current)=>{
            return prev+current;
        },0);
        console.log('平均值：',res/arr.length)

        //03求和
        console.log('总和：',res)

        //04降序排序
        const b = arr.sort((a,b)=>{
            return b-a
        })
        console.log('降序排序结果:',b)

        //05去重
        let items = Array.from(new Set(arr))
        console.log('去重后的数组:',items)
    </script>
</body>
</html>